import type { Goods } from '@/api/modules/data/goods';
import type { Rule } from 'ant-design-vue/es/form';

const formObj: Goods = {
  goodsId: '',
  goodsName: '',
  barCode: undefined,
  salesUnit: '',
  retailPrice: undefined,
  memberPrice: undefined,
  salePrice: undefined,
  qrcodeUrl: '',
  refreshTimes: '',
  goodsPhoto: '',
  deptId: '',
  createTime: '',
  expands: [],
  department: '',
  category: '',
  model: '',
  goodsVideo: '',
  tagCount: [],
  shelfLife: '',
  specif: '',
  sku: '',
  stock: undefined,
  itemNo: '',
  promotionBegin: '',
  promotionEnd: '',
  productionDate: '',
  warehouse: '',
  freightSpace: '',
  share: '0',
  grade: '',
  mode: '',
  origin: '',
  disable: false,
};
export const form = ref({
  ...formObj,
});

export const formRef = ref();

export const resetForm = () => {
  form.value = {
    ...formObj,
  };
};
export const formRules: Record<string, Rule[]> = {};
